

$(function(){
	refresh();
});
function refresh(){
	getYCData();
	getYXData();
	if(param.nbqtype!='NBQ'){
		$("#hlxbtn").hide();
		$("#topPopover").css("height","55px");
	}else{
		$("#hlxbtn").show();
		$("#topPopover").css("height","100px");
	}
}
var psid = param.psid;
var dataHand = new AjaxHandler();
var dws = {"功率":"(kW)","电压":"(V)","电流":"(A)","电量":"(kWh)","频率":"(Hz)","无功":"(kVar)"};

function getYCData(){
	
	$.proAjax({
		url:"/mobile/morpoint/",
		data:{psid:psid,eqid:param.eqid,type:param.type,sintype:"YC"},
		success: function (data){
			var context = $("#tab-YC");
			for(var key in data.info){
				context.find("#"+key).html(data.info[key]);
			}
			dataHand.arrayAddToHtml("YC-model",data.data,"other-YC",function(elm,datas){
				for(var keys in dws){
					if(datas.desc.indexOf(keys)>-1&&datas.desc.indexOf("功率因数")==-1){
						elm.find("#dw").html(dws[keys]);
						break;
					}
				}
			});
		}
	});
}

function getYXData(){
	
	$.proAjax({
		url:"/mobile/morpoint/",
		data:{psid:psid,eqid:param.eqid,type:param.type,sintype:"YX"},
		success: function (data){
			var context = $("#tab-YX");
			for(var key in data.info){
				context.find("#"+key).html(data.info[key]);
			}
			dataHand.arrayAddToHtml("YX-model",data.data,"other-YX",function(elm,datas){
				if(datas.value==1){
					elm.find("#point").addClass("bg-stOne");
				}else{
					elm.find("#point").addClass("bg-stTwo");
				}
			});
		}
	});
}
